﻿@model Kavaa.Modules.PortailMedical.Presentation.Models.MyViewModel
@{
    ViewBag.Title = "Demande";
    Layout = null;  
}
@using System.Web.Optimization
@using BootstrapSupport
@using NavigationRoutes
<!DOCTYPE html>
@if(Session["user"]!= null)
    {
<html lang="en">
    <head>
        <meta charset="utf-8">
        <title>@ViewBag.Title</title>
        @*<meta name="viewport" content="width=device-width, initial-scale=1.0">*@
        <link href="@Styles.Url("~/content/css")" rel="stylesheet"/>
        <link href="@Styles.Url("~/Content/css-responsive")" rel="stylesheet" type="text/css" />
        @* @RenderSection("head", required: false)*@
        @Html.Partial("_html5shiv")
        @* favicons and touch icons go here *@
         @Scripts.Render("~/js")
       

          <script>



              $(document).ready(function () {
             
                  $("#specialite").change(function () {
                      alert("change");
                      var spe = $(this).val();//Date Fin
                      /////////////////////////////////////////////
                      $.ajax({
                          url: '/Cabinet/GetActesSpecialite',//ça marche

                          async: false,
                          type: 'POST',
                          dataType: 'json',
                          data: "specialiteId=" + spe,
                          success: function (databis) {
                              var select = $("#acte_Id");
                              select.empty();
                              select.append($('<option/>', {
                                  value: 0,
                                  text: "--Choix"
                              }));
                              $.each(databis, function (index, itemData) {

                                  select.append($('<option/>', {
                                      value: itemData.Id,
                                      text: itemData.Name
                                  }));
                              });






                          }
                      });



                  });

              });





              function tata() {
                  if (document.getElementById("acte_Id").value != "" && document.getElementById("ville_Id").value != "") {
                      document.getElementById("InfoSelect").style.display = "none";
                      document.getElementById("loading").style.display = "block";
                      $("#loading").fadeIn();
                      var opts = {
                          lines: 12, // The number of lines to draw
                          length: 7, // The length of each line
                          width: 4, // The line thickness
                          radius: 10, // The radius of the inner circle
                          color: '#000', // #rgb or #rrggbb
                          speed: 1, // Rounds per second
                          trail: 60, // Afterglow percentage
                          shadow: false, // Whether to render a shadow
                          hwaccel: false // Whether to use hardware acceleration
                      };
                      var target = document.getElementById('loading');
                      var spinner = new Spinner(opts).spin(target);
                  }
                  else {
                      document.getElementById("loading").style.display = "none";
                      document.getElementById("InfoSelect").style.display = "block";

                  }
              }
              function toto() {
                  document.getElementById("loading").style.display = "none";
              }
              function submit() {
                  document.getElementById("submitbtn").type = "submit";
                  // document.location.reload(true);
              }
              
</script>


         <style  type="text/css">
              #loading
    {
        display:none;
        /*position:fixed;*/
        left:inherit;
        top:inherit;
        width:inherit;
        height:inherit;
        background:rgba(255,255,255,0.8);
       /*z-index:1000;*/
    }
  
    #loadingcontent
    {
        display:table;
        position:absolute;
        left:inherit;
        top:inherit;
        width:inherit;
        height:inherit;
    }
        
    #loadingspinner
    {
        display: table-cell;
        vertical-align:middle;
        width: inherit;
        text-align: center;
        font-size:larger;
        padding-top:inherit;
    }
        </style>

        <style>
             .form-signin {
        
        padding: 19px 29px 29px;
        margin: 0 auto 20px;
        background-color: #fff;
        border: 1px solid #e5e5e5;
        -webkit-border-radius: 5px;
           -moz-border-radius: 5px;
                border-radius: 5px;
        -webkit-box-shadow: 0 1px 2px rgba(0,0,0,.05);
           -moz-box-shadow: 0 1px 2px rgba(0,0,0,.05);
                box-shadow: 0 1px 2px rgba(0,0,0,.05);
      }
        </style>
        <div class="navbar navbar-inverse navbar-top" >
           <div class="navbar-inner"> 
                </div>       
            </div>
                              <div class="container">
     @{
         
         
         var prenomuser = ((Kavaa.Modules.PortailMedical.Entity.Utilisateur)(Session["user"])).Prenom;
       var nomuser = ((Kavaa.Modules.PortailMedical.Entity.Utilisateur)(Session["user"])).Name;}
          <table class="container">
              <tr>
                  <td>
            <img src="/Content/Images/mediciMaroc.png" /> </td>
                  <td class="pull-right">
                      <br />
            <p style="text-align:right"><i class=" icon-user"> </i>&nbsp; &nbsp; @prenomuser  @nomuser  &nbsp; &nbsp;  @Html.ActionLink("Se déconnecter","Deconnexion")&nbsp; &nbsp; </p>
               </td>
           
        
        </tr>
        </table>
                                  </div>
    </head>
   
    <body style="padding:0px; background-color:#fafafa">
        
        <div class="container">
            @Html.Partial("_alerts")
            @Html.Partial("_validationSummary")
            
        
<div id="countDiv">
<div class="container" style="background-color:white">
  <div class="navbar">
  <div class="navbar-inner">
      <div class="container">
        <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
          <div class="nav-collapse collapse">
        <ul class="nav">
      <li > @Html.ActionLink("Accueil","AccueilCabinet")</li>
      <li class="active"> @Html.ActionLink("Accréditation","Accreditation")</li>
      <li>@Html.ActionLink("Réservation","AccueilReservation")</li>
      <li><a href="#">Rapports d'interventions</a></li>
      <li>@Html.ActionLink("Comptes Cabinet","ComptesCabinet")</li>
  
    </ul>
            <form class="navbar-search pull-right">
      <i class="icon-search"></i>
  <input type="text" class="search-query" placeholder="Search">
</form>
  </div>
          </div>
      </div>
         
</div>


   <div style="padding-top:30px;padding-left:-10px; font-size:16px" >
            
           <div class="span3" style="margin-right:20px; margin-left:3px; width:230px">
          <div class="well">
            <ul class="nav nav-list">
              <li class="nav-header"></li>
              <li > @Html.ActionLink("Etat des accréditations", "Accreditation")</li>
              <li class="active"> @Html.ActionLink("Demander Accréditation", "Demande")</li>


              <li><a href="#">Annuler Accréditation</a></li>
             
            </ul>
          </div>
        </div>

   </div>
    
      <!-- Example row of columns -->
      <div style="padding:30px 30px 30px 30px;font-size:16px">
          <table style="width:auto">
              <tr>
                  <td>
                    
          <p>Pour pouvoir consulter la liste des cliniques proposant l'acte médical que vous allez choisir, veuillez préciser les champs suivants:</p>
                      <div style="padding-left:25px">

          <div class="pull-left form-signin">
          <p>Spécialité : </p>

              @{ var nomenclatures = new SelectList(@ViewBag.nomenclatures, "Id", "Name");
                 var actes = new SelectList(@ViewBag.actes, "Id", "Name");
                 var villes = new SelectList(@ViewBag.villes, "Id", "Name");
                 var specialites = new SelectList(@ViewBag.specialites, "Id", "Name");
                      }
              <div id="unique_thing_id">
                     @Html.DropDownListFor(model => model.specialite.Id, @specialites, "--Choix", new { id = "specialite" })
             @using (Ajax.BeginForm("envoi", "test", new AjaxOptions { UpdateTargetId = "list", OnSuccess = "toto" }))
             {
             
                 
                      
          <p>Acte médical :</p>
                                @Html.DropDownListFor(model => model.acte.Id, new SelectList(Enumerable.Empty<SelectListItem>(), "Id", "Name"), 
                            "--Choix")
          <p>Ville :</p>
                  
              @Html.DropDownListFor(model => model.ville.Id, @villes, "--Choix")
<br />
          <button id="submitbtn" class="btn btn-primary"  onclick="tata()" type="submit" >OK</button>
             }</div>
          </div>
                          </div>
                      </td>
                  </tr>
             
         <tr>
             <td >

          <div id="InfoSelect" class="alert alert-info" style="display:none">
                Vous devez sélectionner l'acte et la ville que vous voulez !!
          @*      <button type="button" class="close" data-dismiss="alert">&times;</button>*@
           </div>
           <h4> Liste des cliniques:</h4>
                            <div id="loading" style="color:red;display:none">
                                        <div id="loadingcontent">
                                            <p id="loadingspinner">
                                                Recherche...
                                            </p>
                                        </div>
                              </div>
<br />
<br />
                @* le résultat de la recherche sera mis ici*@
              <div id="list">
                  <div id="result"> 
              </div>
          
                 </td>
             </tr>

           
           </table>



   </div>
  
  
  
    </div>


</div> 
         
            <hr>
            <footer>
                <p>&copy; Kavaa @System.DateTime.Now.ToString("yyyy")</p>
            </footer> 
        </div>
        @* @Scripts.Render("~/js")*@
       @*  @RenderSection("Scripts", required: false)*@
    </body>
</html>
     }
else{
 
  <h5>  Pour pouvoir accéder à cette page veuillez vous connecter :  @Html.ActionLink("Se connecter","SignIn","test") </h5>

}